<?php 
if (isset($_GET['at']) && isset($_GET['on'])){
    $lat=$_GET['at'];
    $lon=$_GET['on'];
}else{
    $lat='39.91488908';
    $lon='116.40387397';
}
if (isset($_GET['op'])){
    $file='./cache/weather/'.$_GET['op'].'.txt';
    $getD=json_decode(file_get_contents($file), true);
    if ($getD['lon'] == $lon &&  $getD['lat'] == $lat){
        if ($getD['expire_time'] > time() ){
            echo json_encode(array('isnew'=>2,'tq'=>$getD['tq'],'tem'=>$getD['tem'],'ty'=>$getD['ty'],'pm'=>$getD['pm'],'wr'=>$getD['wr']));
            exit;
        }
    }
}
$isget='yes';
include 'setweather.php';

